<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html class="site-html">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>云总线App下载</title>
    <link href="../content/css/reset.css" rel="stylesheet"/>
    <link href="../content/css/common.css" rel="stylesheet"/>
    <link href="../content/css/appDownLoad.css" rel="stylesheet"/>
</head>
<body style="overflow:auto;">
<div class="app-download">
    <div class="banner banner2">
        <div class="layout">
            <div class="clearfix">
                <h1 class="logo"></h1>

                <div class="nav">
                    <a href="appDownloadPage.htm" class="active">应用下载</a>
                    <span class="line"></span>
                    <a href="appDownloadIndex.htm">产品介绍</a>
                </div>
            </div>
        </div>
    </div>

    <div class="download-box">
        <div class="inner clearfix">
            <div class="fl">
                <h2>直接下载云总线</h2>

                <div class="btn-box">
                    <a href="http://android.myapp.com/myapp/detail.htm?apkName=com.hns.cloud" class="and-btn" id="andUrl"></a>
                    <a href="https://appsto.re/cn/YdnK9.i" class="ios-btn" id="iosUrl"></a>
                </div>
            </div>

            <div class="fr">
                <h2>扫描二维码下载</h2>

                <div class="ewm-box" id="ewm"></div>
                <!-- <div class="sc_outer_ewm" id="sc_ewm1" style="display: none;"></div>
				<div class="sc_inner_ewm" id="sc_ewm2" style="display: none;"></div> -->
            </div>
        </div>

    </div>
    <div class="app-footer app-footer2">
        © 2015厦门汉纳森软件科技有限公司 闽ICP备15013270号-1
    </div>
</div>
<script src="../content/js/lib/jquery.js"></script>
<script type="text/javascript">
    document.body.addEventListener('touchstart', function () {
    });
    var Wb = document.getElementById("warning-box");
    var Db = document.getElementById("download-btn");
    var $download_btn = $("#download-btn");
    $ios_btn = $("#ios_btn");
    //var $downloadHnsApp = $("#downloadHnsApp");
    
    //TODO
    var host = window.location.host;
    /* if(host.indexOf("183.237.185.68")>=0 || host.indexOf("192.168.182.53")>=0){
    	$("#andUrl").attr("href", "http://"+host+"/can_app/sichuang_can_cloud_android_V1.0.0.apk");
    	$("#iosUrl").attr("href", "http://"+host+"/can_app/sichuang_can_cloud_ios_V1.0.0.ipa");
    	if(host.indexOf("183.237.185.68")>=0){
    		$("#ewm").hide();
    		$("#sc_ewm2").hide();
    		$("#sc_ewm1").show();
    	}else if(host.indexOf("192.168.182.53")>=0){
    		$("#ewm").hide();
    		$("#sc_ewm1").hide();
    		$("#sc_ewm2").show();
    	}
    } */
    /*$.ajaxExt({
    	url : "/logon/commonUrlInfo.htm"
    }).done(function(data){
        if(host.indexOf(data.innerIp)>=0){
        	$("#andUrl").hide("src", data.innerAndUrl);
        	$("#iosUrl").attr("src", data.innerIosUrl);
        	$("#ewm").css({"width": "352px", "height": "206px", "background": "url("+data.innerAppEwm+") no-repeat", "margin-top": "40px"});
        }else{
        	$("#andUrl").attr("src", data.outerAndUrl);
        	$("#iosUrl").attr("src", data.outerIosUrl);
        	$("#ewm").css({"width": "352px", "height": "206px", "background": "url("+data.outerAppEwm+") no-repeat", "margin-top": "40px"});
        }
    });*/
	
	$.ajax({
        url : "../logon/commonUrlInfo.htm",
        //url : url,
        dataType : "JSON",
        success:function(data){
        	if(host.indexOf(data.obj.innerIp)>=0){
				$("#andUrl").attr("href", data.obj.innerAndUrl);
				$("#iosUrl").attr("href", data.obj.innerIosUrl);
				$("#ewm").css({"width": "352px", "height": "206px", "background": "url("+data.obj.innerAppEwm+") no-repeat", "margin-top": "40px"});
			}else{
				$("#andUrl").attr("href", data.obj.outerAndUrl);
				$("#iosUrl").attr("href", data.obj.outerIosUrl);
				$("#ewm").css({"width": "352px", "height": "206px", "background": "url("+data.obj.outerAppEwm+") no-repeat", "margin-top": "40px"});
			}
        }
    });
    
    

    var browser = {
        versions: function () {
            var u = navigator.userAgent, app = navigator.appVersion;
            return {
                mobile: !!u.match(/AppleWebKit.*Mobile.*/)
            };
        }(),
        language: (navigator.browserLanguage || navigator.language)
                .toLowerCase()
    }
    if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
        var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
        if (ua.match(/MicroMessenger/i) == "micromessenger"
                || ua.match(/QQ/i) == "qq") {
            Wb.style.display = "block";
            Db.onclick = function () {
                alert("请点击右上角按钮，然后在弹出的菜单中，选择在浏览器中打开，即可下载安装");
                return false;
            }
        }
    }

    /*
     $download_btn.click(function(){
     var url = $.getProjectName() + "/logon/getHnsApp.htm";
     $downloadHnsApp.attr("action",url);
     $downloadHnsApp.submit();
     });
     */
    /* $ios_btn.click(function(){
     alert("敬请期待！");
     }); */

</script>
</body>
</html>

